package com.itlong.cloud.commons.resource;

import com.itlong.cloud.POJO.PO.SysCodePO;
import com.itlong.cloud.commons.service.IDataDictionaryService;
import com.itlong.cloud.noncore.commons.IDataDictionaryServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <desc>
 *      数据字典业务处理暴露接口实现类
 * </desc>
 *
 * @createDate 2017-10-18
 */
@RestController
public class DataDictionaryServiceResource implements IDataDictionaryServiceClient{
    @Autowired
    IDataDictionaryService iDataDictionaryService;

    /**
     * <desc>
     *      在数据字典中根据类型获取值和名称
     * </desc>
     * @param codeType 类型
     * @return List<SysCodePO> 数据字典实体类集
     * @author zhangs
     * @createDate 2017/10/18
     */
    @Override
    @PostMapping(path = "/setting/getDataDictionary")
    public List<SysCodePO> getDataDictionary(String codeType) throws Exception {
        return iDataDictionaryService.get(codeType);
    }
}
